﻿using IceDog.EFCore.Utils;
using Microsoft.EntityFrameworkCore;

namespace IceDog.EFCore.Cmd.OfficalDemo.Models
{
    public class DioBlogContext : DbContext
    {
        public DbSet<Blog> Blogs { get; set; }
        public DbSet<Post> Posts { get; set; }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            if (!optionsBuilder.IsConfigured)
            {
                optionsBuilder.UseMySql(ConnectionStringHelper.MySql);
            }
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {

        }
    }
}
